<?php echo $header; ?>
<?php if ($error_warning) { ?>
    <div class="warning"><?php echo $error_warning; ?></div>
<?php } ?>
<?php if ($success) { ?>
    <div class="success"><?php echo $success; ?></div>
<?php } ?>
<div class="box">
    <div class="left"></div>
    <div class="right"></div>
    <div class="heading">
        <h1 style="background-image: url('view/image/payment.png');"><?php echo $heading_title; ?></h1>
        <div class="buttons"><a onclick="location = '<?php echo $insert; ?>'" class="button"><span><?php echo $button_insert; ?></span></a><a onclick="$('form').submit();" class="button"><span><?php echo $button_delete; ?></span></a></div>
    </div>
    <div class="content">
        <form action="<?php echo $delete; ?>" method="post" enctype="multipart/form-data" id="form">
            <table class="list">
                <thead>
                    <tr>
                        <td width="1" style="text-align: center;">
                            <input type="checkbox" onclick="$('input[name*=\'selected\']').attr('checked', this.checked);" />
                        </td>
                        <td class="left" style="width: 15%;">
                            <?php if ($sort == 'name') { ?>
                                <a href="<?php echo $sort_name; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_name; ?></a>
                            <?php } else { ?>
                                <a href="<?php echo $sort_name; ?>"><?php echo $column_name; ?></a>
                            <?php } ?>
                        </td>
                        <td class="left" style="width: 45%;">
                            <?php echo $column_description; ?>
                        </td>
                        <td class="left" style="width: 10%;">
                            <?php if ($sort == 'sort_order') { ?>
                                <a href="<?php echo $sort_sort_order; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_sort_order; ?></a>
                            <?php } else { ?>
                                <a href="<?php echo $sort_sort_order; ?>"><?php echo $column_sort_order; ?></a>
                            <?php } ?>
                        </td>                         
                        <td class="left">
                            <?php if ($sort == 'date_modified') { ?>
                                <a href="<?php echo $sort_date_modified; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_date_modified; ?></a>
                            <?php } else { ?>
                                <a href="<?php echo $sort_date_modified; ?>"><?php echo $column_date_modified; ?></a>
                            <?php } ?></td>
                        <td class="right"><?php echo $column_action; ?></td>
                    </tr>
                </thead>
                <tbody>
                    <?php if ($attributes) { ?>
                        <?php foreach ($attributes as $attribute) { ?>
                            <tr>
                                <td style="text-align: center;">
                                    <?php if ($attribute['selected']) { ?>
                                        <input type="checkbox" name="selected[]" value="<?php echo $attribute['attribute_id']; ?>" checked="checked" />
                                    <?php } else { ?>
                                        <input type="checkbox" name="selected[]" value="<?php echo $attribute['attribute_id']; ?>" />
                                    <?php } ?>
                                </td>
                                <td class="left"><?php echo $attribute['name']; ?></td>
                                <td class="left"><?php echo $attribute['description']; ?></td>                            
                                <td class="left"><?php echo $attribute['sort_order']; ?></td>                                 
                                <td class="left"><?php echo $attribute['date_modified']; ?></td>                                    
                                <td class="right">
                                    <?php foreach ($attribute['action'] as $action) { ?>
                                        [ <a href="<?php echo $action['href']; ?>"><?php echo $action['text']; ?></a> ]
                                    <?php } ?>
                                </td>
                            </tr>
                        <?php } ?>
                    <?php } else { ?>
                        <tr>
                            <td class="center" colspan="6"><?php echo $text_no_results; ?></td>
                        </tr>
                    <?php } ?>
                </tbody>
            </table>
        </form>
        <div class="pagination"><?php echo $pagination; ?></div>
    </div>
</div>
<?php echo $footer; ?>